package com.googlecode.i78ba.forum;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface ReplyMapper {
	@Insert({"insert into reply (post_id,content,time,user_id)",
		"values (#{post_id},#{content},#{time},#{user_id})"})
	public void insert(Reply reply);
	
	@Select({"select * from reply where post_id = #{id} order by time"})
	public List<Reply> findByPostId(int id);
	
	public List<Reply> findByParam(Map<String,Object> param);
	
	@Select({"select count(*) from reply where post_id = #{id}"})
	public int findCountByPostId(int id);
}
